import 'package:leancloud_rest_api/leancloud_rest_api.dart';

// LeanCloud_rest_api_test
// https://console.leancloud.cn/apps/qPvlQH0tc9FBY5JY9q3c1Y42-gzGzoHsz/storage/data
final dbConfig = LraDbConfig(
    appId: 'qPvlQH0tc9FBY5JY9q3c1Y42-gzGzoHsz',
    appKey: 'hFEeF1AQ84U0DGot3nRqtYhX',
    serverUrl: 'https://qpvlqh0t.lc-cn-n1-shared.com');

class BookModal extends LraBaseModel {
  String? title;
  String? author;
  UserModal? user;

  BookModal();

  BookModal.fromJson(Map<dynamic, dynamic> json) {
    title = json['title'];
    author = json['author'];
    super.fromJson(json);
    user = LraBaseModel.decodeNestedObject(json, 'user', UserModal.fromJson);
  }
}

class UserModal extends LraBaseModel {
  String? username;

  UserModal();

  UserModal.fromJson(Map<dynamic, dynamic> json) {
    username = json['username'];
    super.fromJson(json);
  }
}
